Integrand size = 27, antiderivative size = 258 \[ \int \frac {(c+d \sec (e+f x))^3}{\sqrt {a+a \sec (e+f x)}} \, dx=\frac {2 (3 c-d) d^2 \tan (e+f x)}{f \sqrt {a+a \sec (e+f x)}}+\frac {2 d^3 \tan (e+f x)}{f \sqrt {a+a \sec (e+f x)}}-\frac {2 d^3 (1-\sec (e+f x)) \tan (e+f x)}{3 f \sqrt {a+a \sec (e+f x)}}+\frac {2 \sqrt {a} c^3 \text {arctanh}\left (\frac {\sqrt {a-a \sec (e+f x)}}{\sqrt {a}}\right ) \tan (e+f x)}{f \sqrt {a-a \sec (e+f x)} \sqrt {a+a \sec (e+f x)}}-\frac {\sqrt {2} \sqrt {a} (c-d)^3 \text {arctanh}\left (\frac {\sqrt {a-a \sec (e+f x)}}{\sqrt {2} \sqrt {a}}\right ) \tan (e+f x)}{f \sqrt {a-a \sec (e+f x)} \sqrt {a+a \sec (e+f x)}} \]
[Out]
Time = 0.25 (sec) , antiderivative size = 258, normalized size of antiderivative = 1.00, number of steps used = 9, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.185, Rules used = {4025, 186, 65, 212, 45} \[ \int \frac {(c+d \sec (e+f x))^3}{\sqrt {a+a \sec (e+f x)}} \, dx=\frac {2 \sqrt {a} c^3 \tan (e+f x) \text {arctanh}\left (\frac {\sqrt {a-a \sec (e+f x)}}{\sqrt {a}}\right )}{f \sqrt {a-a \sec (e+f x)} \sqrt {a \sec (e+f x)+a}}-\frac {\sqrt {2} \sqrt {a} (c-d)^3 \tan (e+f x) \text {arctanh}\left (\frac {\sqrt {a-a \sec (e+f x)}}{\sqrt {2} \sqrt {a}}\right )}{f \sqrt {a-a \sec (e+f x)} \sqrt {a \sec (e+f x)+a}}+\frac {2 d^2 (3 c-d) \tan (e+f x)}{f \sqrt {a \sec (e+f x)+a}}-\frac {2 d^3 \tan (e+f x) (1-\sec (e+f x))}{3 f \sqrt {a \sec (e+f x)+a}}+\frac {2 d^3 \tan (e+f x)}{f \sqrt {a \sec (e+f x)+a}} \]
[In]
[Out]
Rule 45
Rule 65
Rule 186
Rule 212
Rule 4025
Rubi steps \begin{align*} \text {integral}& = -\frac {\left (a^2 \tan (e+f x)\right ) \text {Subst}\left (\int \frac {(c+d x)^3}{x \sqrt {a-a x} (a+a x)} \, dx,x,\sec (e+f x)\right )}{f \sqrt {a-a \sec (e+f x)} \sqrt {a+a \sec (e+f x)}} \\ & = -\frac {\left (a^2 \tan (e+f x)\right ) \text {Subst}\left (\int \left (\frac {(3 c-d) d^2}{a \sqrt {a-a x}}+\frac {c^3}{a x \sqrt {a-a x}}+\frac {d^3 x}{a \sqrt {a-a x}}-\frac {(c-d)^3}{a (1+x) \sqrt {a-a x}}\right ) \, dx,x,\sec (e+f x)\right )}{f \sqrt {a-a \sec (e+f x)} \sqrt {a+a \sec (e+f x)}} \\ & = \frac {2 (3 c-d) d^2 \tan (e+f x)}{f \sqrt {a+a \sec (e+f x)}}-\frac {\left (a c^3 \tan (e+f x)\right ) \text {Subst}\left (\int \frac {1}{x \sqrt {a-a x}} \, dx,x,\sec (e+f x)\right )}{f \sqrt {a-a \sec (e+f x)} \sqrt {a+a \sec (e+f x)}}+\frac {\left (a (c-d)^3 \tan (e+f x)\right ) \text {Subst}\left (\int \frac {1}{(1+x) \sqrt {a-a x}} \, dx,x,\sec (e+f x)\right )}{f \sqrt {a-a \sec (e+f x)} \sqrt {a+a \sec (e+f x)}}-\frac {\left (a d^3 \tan (e+f x)\right ) \text {Subst}\left (\int \frac {x}{\sqrt {a-a x}} \, dx,x,\sec (e+f x)\right )}{f \sqrt {a-a \sec (e+f x)} \sqrt {a+a \sec (e+f x)}} \\ & = \frac {2 (3 c-d) d^2 \tan (e+f x)}{f \sqrt {a+a \sec (e+f x)}}+\frac {\left (2 c^3 \tan (e+f x)\right ) \text {Subst}\left (\int \frac {1}{1-\frac {x^2}{a}} \, dx,x,\sqrt {a-a \sec (e+f x)}\right )}{f \sqrt {a-a \sec (e+f x)} \sqrt {a+a \sec (e+f x)}}-\frac {\left (2 (c-d)^3 \tan (e+f x)\right ) \text {Subst}\left (\int \frac {1}{2-\frac {x^2}{a}} \, dx,x,\sqrt {a-a \sec (e+f x)}\right )}{f \sqrt {a-a \sec (e+f x)} \sqrt {a+a \sec (e+f x)}}-\frac {\left (a d^3 \tan (e+f x)\right ) \text {Subst}\left (\int \left (\frac {1}{\sqrt {a-a x}}-\frac {\sqrt {a-a x}}{a}\right ) \, dx,x,\sec (e+f x)\right )}{f \sqrt {a-a \sec (e+f x)} \sqrt {a+a \sec (e+f x)}} \\ & = \frac {2 (3 c-d) d^2 \tan (e+f x)}{f \sqrt {a+a \sec (e+f x)}}+\frac {2 d^3 \tan (e+f x)}{f \sqrt {a+a \sec (e+f x)}}-\frac {2 d^3 (1-\sec (e+f x)) \tan (e+f x)}{3 f \sqrt {a+a \sec (e+f x)}}+\frac {2 \sqrt {a} c^3 \text {arctanh}\left (\frac {\sqrt {a-a \sec (e+f x)}}{\sqrt {a}}\right ) \tan (e+f x)}{f \sqrt {a-a \sec (e+f x)} \sqrt {a+a \sec (e+f x)}}-\frac {\sqrt {2} \sqrt {a} (c-d)^3 \text {arctanh}\left (\frac {\sqrt {a-a \sec (e+f x)}}{\sqrt {2} \sqrt {a}}\right ) \tan (e+f x)}{f \sqrt {a-a \sec (e+f x)} \sqrt {a+a \sec (e+f x)}} \\ \end{align*}
Result contains higher order function than in optimal. Order 5 vs. order 3 in optimal.
Time = 8.07 (sec) , antiderivative size = 787, normalized size of antiderivative = 3.05 \[ \int \frac {(c+d \sec (e+f x))^3}{\sqrt {a+a \sec (e+f x)}} \, dx=\frac {2 \cos \left (\frac {1}{2} (e+f x)\right ) (c+d \sec (e+f x))^3 \sqrt {\frac {1}{1-2 \sin ^2\left (\frac {1}{2} (e+f x)\right )}} \sqrt {1-2 \sin ^2\left (\frac {1}{2} (e+f x)\right )} \left (\frac {2 c \left (c^2+3 d^2\right ) \sin \left (\frac {1}{2} (e+f x)\right )}{3 \left (1-2 \sin ^2\left (\frac {1}{2} (e+f x)\right )\right )^{3/2}}-\frac {4 c^2 (c+3 d) \sin ^3\left (\frac {1}{2} (e+f x)\right )}{3 \left (1-2 \sin ^2\left (\frac {1}{2} (e+f x)\right )\right )^{3/2}}+\frac {4 c \left (c^2+3 d^2\right ) \sin \left (\frac {1}{2} (e+f x)\right )}{3 \sqrt {1-2 \sin ^2\left (\frac {1}{2} (e+f x)\right )}}+\frac {1}{3} c^3 \csc \left (\frac {1}{2} (e+f x)\right ) \sqrt {1-2 \sin ^2\left (\frac {1}{2} (e+f x)\right )} \left (\frac {4 \sin ^4\left (\frac {1}{2} (e+f x)\right )}{\left (1-2 \sin ^2\left (\frac {1}{2} (e+f x)\right )\right )^2}-\frac {6 \sin ^2\left (\frac {1}{2} (e+f x)\right )}{1-2 \sin ^2\left (\frac {1}{2} (e+f x)\right )}+\frac {3 \sqrt {2} \arcsin \left (\sqrt {2} \sin \left (\frac {1}{2} (e+f x)\right )\right ) \sin \left (\frac {1}{2} (e+f x)\right )}{\sqrt {1-2 \sin ^2\left (\frac {1}{2} (e+f x)\right )}}\right )-\frac {(c-d)^3 \csc ^5\left (\frac {1}{2} (e+f x)\right ) \left (-12 \cos ^4\left (\frac {1}{2} (e+f x)\right ) \, _3F_2\left (2,2,\frac {7}{2};1,\frac {9}{2};-\frac {\sin ^2\left (\frac {1}{2} (e+f x)\right )}{1-2 \sin ^2\left (\frac {1}{2} (e+f x)\right )}\right ) \sin ^8\left (\frac {1}{2} (e+f x)\right )-12 \operatorname {Hypergeometric2F1}\left (2,\frac {7}{2},\frac {9}{2},-\frac {\sin ^2\left (\frac {1}{2} (e+f x)\right )}{1-2 \sin ^2\left (\frac {1}{2} (e+f x)\right )}\right ) \sin ^8\left (\frac {1}{2} (e+f x)\right ) \left (4-7 \sin ^2\left (\frac {1}{2} (e+f x)\right )+3 \sin ^4\left (\frac {1}{2} (e+f x)\right )\right )+7 \sqrt {-\frac {\sin ^2\left (\frac {1}{2} (e+f x)\right )}{1-2 \sin ^2\left (\frac {1}{2} (e+f x)\right )}} \left (1-2 \sin ^2\left (\frac {1}{2} (e+f x)\right )\right )^3 \left (15-20 \sin ^2\left (\frac {1}{2} (e+f x)\right )+8 \sin ^4\left (\frac {1}{2} (e+f x)\right )\right ) \left (\left (3-7 \sin ^2\left (\frac {1}{2} (e+f x)\right )\right ) \sqrt {-\frac {\sin ^2\left (\frac {1}{2} (e+f x)\right )}{1-2 \sin ^2\left (\frac {1}{2} (e+f x)\right )}}-3 \text {arctanh}\left (\sqrt {-\frac {\sin ^2\left (\frac {1}{2} (e+f x)\right )}{1-2 \sin ^2\left (\frac {1}{2} (e+f x)\right )}}\right ) \left (1-2 \sin ^2\left (\frac {1}{2} (e+f x)\right )\right )\right )\right )}{63 \left (1-2 \sin ^2\left (\frac {1}{2} (e+f x)\right )\right )^{7/2}}\right )}{f (d+c \cos (e+f x))^3 \sec ^{\frac {5}{2}}(e+f x) \sqrt {a (1+\sec (e+f x))}} \]
[In]
[Out]
Leaf count of result is larger than twice the leaf count of optimal. \(508\) vs. \(2(227)=454\).
Time = 5.60 (sec) , antiderivative size = 509, normalized size of antiderivative = 1.97
method | result | size |
parts | \(-\frac {c^{3} \sqrt {a \left (\sec \left (f x +e \right )+1\right )}\, \sqrt {-\frac {\cos \left (f x +e \right )}{\cos \left (f x +e \right )+1}}\, \left (\sqrt {2}\, \ln \left (\csc \left (f x +e \right )-\cot \left (f x +e \right )+\sqrt {\cot \left (f x +e \right )^{2}-2 \csc \left (f x +e \right ) \cot \left (f x +e \right )+\csc \left (f x +e \right )^{2}-1}\right )-2 \,\operatorname {arctanh}\left (\frac {\sin \left (f x +e \right )}{\left (\cos \left (f x +e \right )+1\right ) \sqrt {-\frac {\cos \left (f x +e \right )}{\cos \left (f x +e \right )+1}}}\right )\right )}{f a}+\frac {d^{3} \sqrt {-\frac {2 a}{\left (1-\cos \left (f x +e \right )\right )^{2} \csc \left (f x +e \right )^{2}-1}}\, \left (3 \ln \left (\csc \left (f x +e \right )-\cot \left (f x +e \right )+\sqrt {\left (1-\cos \left (f x +e \right )\right )^{2} \csc \left (f x +e \right )^{2}-1}\right ) \left (\left (1-\cos \left (f x +e \right )\right )^{2} \csc \left (f x +e \right )^{2}-1\right )^{\frac {3}{2}}-4 \left (1-\cos \left (f x +e \right )\right )^{3} \csc \left (f x +e \right )^{3}\right )}{3 f a \left (\left (1-\cos \left (f x +e \right )\right )^{2} \csc \left (f x +e \right )^{2}-1\right )}+\frac {3 c^{2} d \sqrt {-\frac {\cos \left (f x +e \right )}{\cos \left (f x +e \right )+1}}\, \sqrt {a \left (\sec \left (f x +e \right )+1\right )}\, \sqrt {2}\, \ln \left (\csc \left (f x +e \right )-\cot \left (f x +e \right )+\sqrt {\cot \left (f x +e \right )^{2}-2 \csc \left (f x +e \right ) \cot \left (f x +e \right )+\csc \left (f x +e \right )^{2}-1}\right )}{f a}-\frac {3 c \,d^{2} \sqrt {a \left (\sec \left (f x +e \right )+1\right )}\, \left (\sqrt {2}\, \sqrt {-\frac {\cos \left (f x +e \right )}{\cos \left (f x +e \right )+1}}\, \ln \left (\csc \left (f x +e \right )-\cot \left (f x +e \right )+\sqrt {\cot \left (f x +e \right )^{2}-2 \csc \left (f x +e \right ) \cot \left (f x +e \right )+\csc \left (f x +e \right )^{2}-1}\right )+2 \cot \left (f x +e \right )-2 \csc \left (f x +e \right )\right )}{f a}\) | \(509\) |
default | \(\frac {\left (3 \left (\left (1-\cos \left (f x +e \right )\right )^{2} \csc \left (f x +e \right )^{2}-1\right )^{\frac {3}{2}} \sqrt {2}\, \operatorname {arctanh}\left (\frac {\sqrt {2}\, \left (-\cot \left (f x +e \right )+\csc \left (f x +e \right )\right )}{\sqrt {\left (1-\cos \left (f x +e \right )\right )^{2} \csc \left (f x +e \right )^{2}-1}}\right ) c^{3}-3 \left (\left (1-\cos \left (f x +e \right )\right )^{2} \csc \left (f x +e \right )^{2}-1\right )^{\frac {3}{2}} \ln \left (\csc \left (f x +e \right )-\cot \left (f x +e \right )+\sqrt {\left (1-\cos \left (f x +e \right )\right )^{2} \csc \left (f x +e \right )^{2}-1}\right ) c^{3}+9 \left (\left (1-\cos \left (f x +e \right )\right )^{2} \csc \left (f x +e \right )^{2}-1\right )^{\frac {3}{2}} \ln \left (\csc \left (f x +e \right )-\cot \left (f x +e \right )+\sqrt {\left (1-\cos \left (f x +e \right )\right )^{2} \csc \left (f x +e \right )^{2}-1}\right ) c^{2} d -9 \left (\left (1-\cos \left (f x +e \right )\right )^{2} \csc \left (f x +e \right )^{2}-1\right )^{\frac {3}{2}} \ln \left (\csc \left (f x +e \right )-\cot \left (f x +e \right )+\sqrt {\left (1-\cos \left (f x +e \right )\right )^{2} \csc \left (f x +e \right )^{2}-1}\right ) c \,d^{2}+3 \left (\left (1-\cos \left (f x +e \right )\right )^{2} \csc \left (f x +e \right )^{2}-1\right )^{\frac {3}{2}} \ln \left (\csc \left (f x +e \right )-\cot \left (f x +e \right )+\sqrt {\left (1-\cos \left (f x +e \right )\right )^{2} \csc \left (f x +e \right )^{2}-1}\right ) d^{3}+18 c \,d^{2} \left (1-\cos \left (f x +e \right )\right )^{3} \csc \left (f x +e \right )^{3}-4 d^{3} \left (1-\cos \left (f x +e \right )\right )^{3} \csc \left (f x +e \right )^{3}-18 c \,d^{2} \left (-\cot \left (f x +e \right )+\csc \left (f x +e \right )\right )\right ) \sqrt {-\frac {2 a}{\left (1-\cos \left (f x +e \right )\right )^{2} \csc \left (f x +e \right )^{2}-1}}}{3 f a \left (-\cot \left (f x +e \right )+\csc \left (f x +e \right )+1\right ) \left (-\cot \left (f x +e \right )+\csc \left (f x +e \right )-1\right )}\) | \(512\) |
[In]
[Out]
none
Time = 7.80 (sec) , antiderivative size = 619, normalized size of antiderivative = 2.40 \[ \int \frac {(c+d \sec (e+f x))^3}{\sqrt {a+a \sec (e+f x)}} \, dx=\left [-\frac {3 \, \sqrt {2} {\left ({\left (a c^{3} - 3 \, a c^{2} d + 3 \, a c d^{2} - a d^{3}\right )} \cos \left (f x + e\right )^{2} + {\left (a c^{3} - 3 \, a c^{2} d + 3 \, a c d^{2} - a d^{3}\right )} \cos \left (f x + e\right )\right )} \sqrt {-\frac {1}{a}} \log \left (-\frac {2 \, \sqrt {2} \sqrt {\frac {a \cos \left (f x + e\right ) + a}{\cos \left (f x + e\right )}} \sqrt {-\frac {1}{a}} \cos \left (f x + e\right ) \sin \left (f x + e\right ) - 3 \, \cos \left (f x + e\right )^{2} - 2 \, \cos \left (f x + e\right ) + 1}{\cos \left (f x + e\right )^{2} + 2 \, \cos \left (f x + e\right ) + 1}\right ) + 6 \, {\left (c^{3} \cos \left (f x + e\right )^{2} + c^{3} \cos \left (f x + e\right )\right )} \sqrt {-a} \log \left (\frac {2 \, a \cos \left (f x + e\right )^{2} + 2 \, \sqrt {-a} \sqrt {\frac {a \cos \left (f x + e\right ) + a}{\cos \left (f x + e\right )}} \cos \left (f x + e\right ) \sin \left (f x + e\right ) + a \cos \left (f x + e\right ) - a}{\cos \left (f x + e\right ) + 1}\right ) - 4 \, {\left (d^{3} + {\left (9 \, c d^{2} - d^{3}\right )} \cos \left (f x + e\right )\right )} \sqrt {\frac {a \cos \left (f x + e\right ) + a}{\cos \left (f x + e\right )}} \sin \left (f x + e\right )}{6 \, {\left (a f \cos \left (f x + e\right )^{2} + a f \cos \left (f x + e\right )\right )}}, -\frac {6 \, {\left (c^{3} \cos \left (f x + e\right )^{2} + c^{3} \cos \left (f x + e\right )\right )} \sqrt {a} \arctan \left (\frac {\sqrt {\frac {a \cos \left (f x + e\right ) + a}{\cos \left (f x + e\right )}} \cos \left (f x + e\right )}{\sqrt {a} \sin \left (f x + e\right )}\right ) - 2 \, {\left (d^{3} + {\left (9 \, c d^{2} - d^{3}\right )} \cos \left (f x + e\right )\right )} \sqrt {\frac {a \cos \left (f x + e\right ) + a}{\cos \left (f x + e\right )}} \sin \left (f x + e\right ) - \frac {3 \, \sqrt {2} {\left ({\left (a c^{3} - 3 \, a c^{2} d + 3 \, a c d^{2} - a d^{3}\right )} \cos \left (f x + e\right )^{2} + {\left (a c^{3} - 3 \, a c^{2} d + 3 \, a c d^{2} - a d^{3}\right )} \cos \left (f x + e\right )\right )} \arctan \left (\frac {\sqrt {2} \sqrt {\frac {a \cos \left (f x + e\right ) + a}{\cos \left (f x + e\right )}} \cos \left (f x + e\right )}{\sqrt {a} \sin \left (f x + e\right )}\right )}{\sqrt {a}}}{3 \, {\left (a f \cos \left (f x + e\right )^{2} + a f \cos \left (f x + e\right )\right )}}\right ] \]
[In]
[Out]
\[ \int \frac {(c+d \sec (e+f x))^3}{\sqrt {a+a \sec (e+f x)}} \, dx=\int \frac {\left (c + d \sec {\left (e + f x \right )}\right )^{3}}{\sqrt {a \left (\sec {\left (e + f x \right )} + 1\right )}}\, dx \]
[In]
[Out]
\[ \int \frac {(c+d \sec (e+f x))^3}{\sqrt {a+a \sec (e+f x)}} \, dx=\int { \frac {{\left (d \sec \left (f x + e\right ) + c\right )}^{3}}{\sqrt {a \sec \left (f x + e\right ) + a}} \,d x } \]
[In]
[Out]
Exception generated. \[ \int \frac {(c+d \sec (e+f x))^3}{\sqrt {a+a \sec (e+f x)}} \, dx=\text {Exception raised: TypeError} \]
[In]
[Out]
Timed out. \[ \int \frac {(c+d \sec (e+f x))^3}{\sqrt {a+a \sec (e+f x)}} \, dx=\int \frac {{\left (c+\frac {d}{\cos \left (e+f\,x\right )}\right )}^3}{\sqrt {a+\frac {a}{\cos \left (e+f\,x\right )}}} \,d x \]
[In]
[Out]